﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace baituan1._2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            float c;
            float a = Convert.ToInt32(this.textBox1.Text);
            float b = Convert.ToInt32(this.textBox2.Text);
            if (comboBox1.SelectedIndex == 0)
            {
                c = a + b;
                textBox3.Text = c.ToString();
            }
            if (comboBox1.SelectedIndex == 1)
            {
                c = a - b;
                textBox3.Text = c.ToString();
            }
            if (comboBox1.SelectedIndex == 2)
            {

                c = a * b;
                textBox3.Text = c.ToString();
            }
            if (comboBox1.SelectedIndex == 3)
            {
                c = a / b;
                textBox3.Text = c.ToString();
            } 
            
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
